Conventional computer graphic systems enable users to create various types of computer graphics content such as free form illustration, engineering design, or other types of technical or non-technical computer graphics. Often, these conventional systems employ vector-based curves, such as Bezier curves, which are represented by compact mathematical equations having a fixed number of parameters. In addition, conventional systems often employ a graphics rendering model called a graphics pipeline to display two-dimensional and three-dimensional data on a display. A typical graphics pipeline generally includes processing data using both a central processing unit (CPU) and graphics processing unit (GPU) of a computing device. As one example, the CPU first processes data associated with a Bezier curve. This data is passed to the GPU to graphically render the data on a display.
In general, conventional systems rendering using GPUs employ one of two approaches to render cubic Bezier curves: curve approximation by degree reduction or two-pass stencil and cover. Although conventional systems can produce adequate results in some applications, there remains a number of problems and disadvantages with respect to conventional processing and rendering of geometry bounded by cubic Bezier splines. In particular, the curve approximation fails to accurately render the bounded geometry in a resolution independent fashion especially at high scale values, while the two pass stencil and cover technique relies on multisampling to produce a smooth appearance, which requires significant memory. Moreover, conventional systems using the curve approximation and/or the two-pass stencil approach use excessive computer resources (e.g., a large processor and memory footprint), which degrades performance of conventional systems when rendering Bezier curves.
For example, under the curve approximation approach, conventional systems approximate a curve by dividing a single cubic Bezier curve into several quadratic Bezier curves and/or straight-line segments. The curve approximation approach, however, often creates aberrations from the original geometry of the cubic Bezier curve (e.g., approximation error), and thus results in an inaccurate curve. Further, the curve approximation approach is computationally expensive on the CPU, increases data transfer times from the CPU to the GPU, and requires significant computer memory resources. Depending on various factors, conventional systems can apply a large approximation tolerance, which results in minimizing the number of quadratic segments (e.g., 5-10) to process per cubic Bezier curve. With a large approximation tolerance, however, the inaccuracy of the approximated curve often increases and creates noticeable artifact when the approximated curve is rendered. In addition, when a user zooms in on the approximated curve, the inaccuracies of the approximation become more apparent due to amplification of the approximation error.
In an attempt to overcome the poor results of a large approximation tolerance, conventional systems can decrease the approximation tolerance. With a low approximation tolerance, the curve approximation approach produces a large number of quadratic Bezier curve segments (e.g., 20-50). A large number of quadratic Bezier curve segments requires the CPU to process large amounts data, the CPU to pass large amounts of data to the GPU, and the GPU to render the large amount of data. Thus, a low approximation tolerance results in a computationally expensive process that significantly degrades performance of the system. Further, even with a low approximation tolerance, because the rendered curve is still an approximation, inaccuracies with the approximated curve are often still noticeable.
The two-pass stencil and cover approach also suffers from several disadvantages. Under the two-pass stencil and cover approach, conventional systems render the cubic Bezier curve into a stencil directly on the GPU of a computing device, which provides coverage of the cubic Bezier curve. Then, conventional systems perform a second pass to fill in each of the pixels on the coverage. While the two-pass approach can be more accurate than the approximate approach, it is inefficient, computationally expensive, and results in significant performance bottlenecks at the GPU. In addition, the two-pass stencil and cover approach often produces noticeable aliasing, which can result in an inaccurate and jagged curve appearance.
Because each of the above approaches results in inaccurate and aliased curves, some conventional systems further use multisampling anti-aliasing (MSAA) in an attempt to correct aliased pixels on a rendered curve. However, MSAA further requires large allocations of memory (e.g., often 8 times the size of the sample) to perform anti-aliasing. Thus, MSAA adds significantly more memory requirements to the above-constrained approaches, which already require a large memory footprint and processing resources to render a cubic Bezier curve. In addition, as display densities or artwork complexity increase, performance degradation significantly increases, resulting in a significantly computationally inefficient system that requires high memory and computational bandwidth that often fails to render cubic Bezier curves accurately.